<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>登陆</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="/static/aui/css/css/amazeui.min.css">
    <link rel="stylesheet" href="/static/aui/css/css/app.css">
    <script type="text/javascript" src="/static/aui/css/js/jquery.min.js"></script>
    <script type="text/javascript" src="/static/aui/css/js/jquerys.min.js"></script>
    <script type="text/javascript" src="/static/aui/css/js/qrcode.js"></script>
    <!--<script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>-->
</head>
<style>
    .myapp-login .myapp-login-form .am-form .am-form-group input {
        font-size: 14px;
        padding: 10px 0;
        background: none;
        border: none;
        text-align: left;
        border-bottom: 1px solid black;
        color: black;
    }

    .myapp-login .myapp-login-form .am-form button {
        background: #367FFF;
        width: 100%;
        border-radius: 30px;
        color: #fff;
        border: none;
        font-size: 14px;
        margin-top: 20px;
    }

    input:focus {
        font-size: 14px !important;
        padding: 10px 0 !important;
        background: none !important;
        border: none !important;
        text-align: left !important;
        border-bottom: 1px solid black !important;
        color: black !important;
    }

    #qrcodeBox {
        width: 100%;
        height: 100%;
        text-align: center;
        align-content: center;
        display: none;
    }

    #qrcode {
        width: 200px;
        margin: 0 auto
    }

    .tipWindow {
        display: none;
        width: 100%;
        height: 100%;
        position: fixed;
        left: 0;
        top: 0;
        right: 0;
    }

    .tipMain {
        width: 14rem;
        height: 8rem;
        background: rgba(0, 0, 0, .81);
        border-radius: .5rem;
        position: absolute;;
        left: 50%;
        margin-left: -7rem;
        top: 50%;
        margin-top: -4rem;
    }

    .tiptitle {
        padding: 1.5rem .5rem;
        overflow: hidden;
        min-height: 2rem;
        font-size: .8rem;
        line-height: 1rem;
        border-bottom: 1px solid #fff;
        text-align: center;
        color: #fff;
    }

    .erro .tipMain {
        height: 6rem;
    }

    .erro .tipMain .tiptitle {
        padding: 1rem .5rem;
        overflow: hidden;
        min-height: 1rem;
        font-size: .8rem;
        line-height: 1rem;
        border-bottom: 1px solid #fff;
        text-align: center;
        color: #fff;
    }

    .knowbtn {
        display: block;
        text-align: center;
        font-size: .875rem;
        color: #fff;
        line-height: 3rem;
    }

    .knowbtntitles {
        display: block;
        text-align: center;
        font-size: .875rem;
        color: #666;
        line-height: 3rem;
        font-size: 12px;
        float: left;
    }

    .knowbtntitle-r {
        display: block;
        text-align: center;
        font-size: .875rem;
        color: #666;
        line-height: 3rem;
        font-size: 12px;
        float: right;
    }

    .verifyimg {

    }
</style>
<body>
<div class="am-g myapp-login">
    <div class="myapp-login-bg">
        <div class="myapp-login-logo">
            <img style="width:95px;height: 95px; " src="/static/aui/css/css/logos.jpg">
        </div>
        <div class="am-u-sm-10 myapp-login-form" style="margin-top: 0px;">
            <div class="am-form">
                <fieldset>
                    <input type="hidden" id="referrer_phone" name="referrer_phone" value="{$data.referrer_phone}">
                    <input type="hidden" id="type" name="type" value="{$data.type}">

                    <div class="am-form-group">
                        <label for="doc-ipt-email-1">账号(手机号码)</label>
                        <input type="text" class="" hidefocus="true" id="phone" value="" placeholder="账号(手机号码)"
                               style=":force">
                    </div>
                    <div class="am-form-group">
                        <label for="doc-ipt-email-1">密码</label>
                        <input type="password" class="" hidefocus="true" id="pasw_login" value="" placeholder="请输入密码"
                               style=":force">
                    </div>

                    <a href="/index.php/member/Login/Make_info/referrer_phone/{$data.referrer_phone}/type/{$data.type}"
                       class="knowbtntitles"> 分享二维码？</a>
                    <a href="/index.php/member/Login/register/referrer_phone/{$data.referrer_phone}/type/{$data.type}"
                       class="knowbtntitle-r">去注册</a>
                    <p>
                        <button type="submit" id="submit" class="am-btn am-btn-default">登 陆</button>
                    </p>
                </fieldset>
            </div>
        </div>
    </div>

</div>


<div class="tipWindow resphone">
    <div class="tipMain">
        <div class="tiptitle">填写正确的手机号码!</div>
        <div class="knowbtn" id="knowbtnhone">我知道了</div>
    </div>
</div>
<div class="tipWindow outsrcf">
    <div class="tipMain">
        <div class="tiptitle">密码必填!</div>
        <div class="knowbtn" id="knowbtsrcf">我知道了</div>
    </div>
</div>

<div class="tipWindow err">
    <div class="tipMain">
        <div class="tiptitle" id="tiptitleerr"></div>
        <div class="knowbtn" id="knowbterrs">我知道了</div>
    </div>
</div>
</body>
</html>
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/static/aui/css/js/jquery.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="/static/aui/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<script src="/static/aui/css/js/amazeui.min.js"></script>
<script src="/static/aui/css/js/app.js"></script>

<script>

    $('#submit').click(function () {
        var phone = $('#phone').val().replace(/\s+/g, ""); //获取输入手机号
        var pasw_login = $('#pasw_login').val().replace(/\s+/g, ""); //获取验证码
        var type = $('#type').val(); //获取验证码
        var referrer_phone = $('#referrer_phone').val(); //获取验证码

        if (!phone) {
            $(".resphone").fadeIn();
            return false;
        }
        if (!type) {
            type = '';
        }
        if (!referrer_phone) {
            referrer_phone = '';
        }
        if (!pasw_login) {
            $(".outsrcf").fadeIn();
            return false;
        }
        if (phone && pasw_login) {
            //ajax请求注册
            $.ajax({
                type: "POST",
                url: "/index.php/member/Login/weblogin",
                data: {
                    phone: phone,
                    password: pasw_login,
                    type: type,
                    referrer_phone: referrer_phone,
                },
                dataType: "json",
                success: function (data) {
                    if (data.code == 1) {
                        window.location.href = '/index.php/versions/download/index';
                        return false;
                    } else {
                        $("#tiptitleerr").html(data.msg);
                        $(".err").fadeIn();
                        return false;
                    }
                }
            });
        }
    });
    $("#knowbtsrcf").click(function () {
        $(".outsrcf").fadeOut();
    });
    $("#knowbtnhone").click(function () {
        $(".resphone").fadeOut();
    });
    $("#knowbterr").click(function () {
        $(".outerr").fadeOut();
    });
    $("#knowbtcsrferr").click(function () {
        $(".outcsrferr").fadeOut();
    });
    $("#knowbtregisterr").click(function () {
        $(".outregisterr").fadeOut();
    });
    $("#knowbterrs").click(function () {
        $(".err").fadeOut();
    });
</script>

